home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / dev / gcc / GccFindHit.lha / defs.h < prev    next >
C/C++ Source or Header  |  1995-05-21  |  2KB  |  79 lines

  1. /* defs.h -- this file is part of GccFindHit
  2. *  Copyright (C) 1995 Daniel Verite -- daniel@brasil.frmug.fr.net
  3. *  This program is distributed under the General GNU Public License version 2
  4. *  See the file COPYING for information about the GPL
  5. */
  6.  
  7. #ifdef LITTLE_ENDIAN
  8. /* reverse for endianness */
  9. #define GETLONG(x) ((((((x)&0xff)<<8) | (((x)&0xff00)>>8))<<16) | \
  10.            (((((x)&0xff000000)>>8)&0x00ff0000) | \
  11.            ((x)&0x00ff0000)<<8)>>16)
  12. #define GETWORD(x) ((((x)&0xff)<<8) | ((((x)&0xff00)>>8)&0xff))
  13. #else
  14. #define GETLONG(x) (x)
  15. #define GETWORD(x) (x)
  16. #endif
  17.  
  18. #define    ZMAGIC    0x10b    /* demand-paged executable */
  19. #define    N_SO    0x64
  20. #define    N_SOL    0x84
  21. #define    N_SLINE    0x44
  22.  
  23. /* Converts an SLINE value to an offset in the text section.
  24.    This definition is OK for ld 1.8, currently used on the Amiga AFAIK,
  25.    but you may change that for another linker */
  26. #define OFFSET_N_SLINE(x) (x)
  27.  
  28. enum {
  29.   HUNK_UNIT=0x3e7,
  30.   HUNK_NAME,
  31.   HUNK_CODE,
  32.   HUNK_DATA,
  33.   HUNK_BSS,
  34.   HUNK_RELOC32,
  35.   HUNK_RELOC16,
  36.   HUNK_RELOC8,
  37.   HUNK_EXT,
  38.   HUNK_SYMBOL,
  39.   HUNK_DEBUG,
  40.   HUNK_END,
  41.   HUNK_HEADER,
  42.   HUNK_3F4, /* ? */
  43.   HUNK_OVERLAY,
  44.   HUNK_BREAK,
  45.   HUNK_DRELOC32,
  46.   HUNK_DRELOC16,
  47.   HUNK_DRELOC8,
  48.   HUNK_3FA, /* ? */
  49.   HUNK_LIB,
  50.  /* AmigaDOS Manual 3rd ed. takes 0x3fc for HUNK_INDEX and HUNK_RELOC32SHORT.
  51.     I don't know if it's an error or something; anyway, there shouldn't be
  52.     HUNK_INDEX in executable files, so let's take the other one */
  53.   HUNK_RELOC32SHORT
  54. };
  55.  
  56. /* amigados hunk header structure */
  57. struct Header {
  58.   long    nb_hunks;
  59.   long    first;
  60.   long    last;
  61.   long    sizes[1];
  62. };
  63.  
  64. /* bsd header structure */
  65. struct bsd_header{
  66.   long    magic;
  67.   long    symsz;
  68.   long    strsz;
  69. };
  70.  
  71. typedef struct {
  72.   long strx;
  73.   unsigned char    type;
  74.   unsigned char other;
  75.   unsigned short desc;
  76.   long    value;
  77. } BSD_SYM;
  78.  
  79.